//
//  KuaiSanCell.m
//  K8彩票
//
//  Created by zyn on 2017/6/6.
//  Copyright © 2017年 zhoubo. All rights reserved.
//

#import "KuaiSanCell.h"

@implementation KuaiSanCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(void)setContentJiangSuKuai3:(NSMutableArray *)array{
    CaipiaoHistoryModel *model = array[0];
    CaipiaoHistoryModel *modelS1 = array[1];
    CaipiaoHistoryModel *modelS2 = array[2];
    
    _labelName.text = NSLocalizedString(@"江苏快三", @"江苏快三");
    _labelQiHao.text = [NSString stringWithFormat:NSLocalizedString(@"第%@期", @"第%@期"),model.issueno];
    NSArray *arrs = [model.number componentsSeparatedByString:@" "];
    [_image1 setImage:[UIImage imageNamed:[NSString stringWithFormat:@"%@",arrs[0]]]];
    [_image2 setImage:[UIImage imageNamed:[NSString stringWithFormat:@"%@",arrs[1]]]];
    [_image3 setImage:[UIImage imageNamed:[NSString stringWithFormat:@"%@",arrs[2]]]];
    
    _labelS1QiHao.text = modelS1.issueno;
    NSArray *arrsS1 = [modelS1.number componentsSeparatedByString:@" "];
    [_imageS11 setImage:[UIImage imageNamed:[NSString stringWithFormat:@"%@",arrsS1[0]]]];
    [_imageS12 setImage:[UIImage imageNamed:[NSString stringWithFormat:@"%@",arrsS1[1]]]];
    [_imageS13 setImage:[UIImage imageNamed:[NSString stringWithFormat:@"%@",arrsS1[2]]]];
    int totalS1 = [arrsS1[0] intValue] + [arrsS1[1] intValue] + [arrsS1[2] intValue];
    _labelS1Total.text =  [NSString stringWithFormat:@"%d",totalS1];
    if(totalS1 < 10)
        _labelS1Type1.text = NSLocalizedString(@"小", @"小");
    else
        _labelS1Type1.text = NSLocalizedString(@"大", @"大");
    
    if (totalS1 % 2 == 0)
        _labelS1Type2.text = NSLocalizedString(@"双", @"双");
    else
        _labelS1Type2.text = NSLocalizedString(@"单", @"单");
    
    _labelS2QiHao.text = modelS2.issueno;
    NSArray *arrsS2 = [modelS2.number componentsSeparatedByString:@" "];
    [_imageS21 setImage:[UIImage imageNamed:[NSString stringWithFormat:@"%@",arrsS2[0]]]];
    [_imageS22 setImage:[UIImage imageNamed:[NSString stringWithFormat:@"%@",arrsS2[1]]]];
    [_imageS23 setImage:[UIImage imageNamed:[NSString stringWithFormat:@"%@",arrsS2[2]]]];
    int totalS2 = [arrsS2[0] intValue] + [arrsS2[1] intValue] + [arrsS2[2] intValue];
    _labelS2Total.text =  [NSString stringWithFormat:@"%d",totalS2];
    if(totalS2 < 10)
        _labelS2Type1.text = NSLocalizedString(@"小", @"小");
    else
        _labelS2Type1.text = NSLocalizedString(@"大", @"大");
    
    if (totalS2 % 2 == 0)
        _labelS2Type2.text = NSLocalizedString(@"双", @"双");
    else
        _labelS2Type2.text = NSLocalizedString(@"单", @"单");
}

-(void)setContentHuBeiKuai3:(NSMutableArray *)array{
    CaipiaoHistoryModel *model = array[0];
    CaipiaoHistoryModel *modelS1 = array[1];
    CaipiaoHistoryModel *modelS2 = array[2];
    
    _labelName.text = NSLocalizedString(@"湖北快三", @"湖北快三");
    _labelQiHao.text = [NSString stringWithFormat:NSLocalizedString(@"第%@期", @"第%@期"),model.issueno];
    NSArray *arrs = [model.number componentsSeparatedByString:@" "];
    [_image1 setImage:[UIImage imageNamed:[NSString stringWithFormat:@"%@",arrs[0]]]];
    [_image2 setImage:[UIImage imageNamed:[NSString stringWithFormat:@"%@",arrs[1]]]];
    [_image3 setImage:[UIImage imageNamed:[NSString stringWithFormat:@"%@",arrs[2]]]];
    
    _labelS1QiHao.text = modelS1.issueno;
    NSArray *arrsS1 = [modelS1.number componentsSeparatedByString:@" "];
    [_imageS11 setImage:[UIImage imageNamed:[NSString stringWithFormat:@"%@",arrsS1[0]]]];
    [_imageS12 setImage:[UIImage imageNamed:[NSString stringWithFormat:@"%@",arrsS1[1]]]];
    [_imageS13 setImage:[UIImage imageNamed:[NSString stringWithFormat:@"%@",arrsS1[2]]]];
    int totalS1 = [arrsS1[0] intValue] + [arrsS1[1] intValue] + [arrsS1[2] intValue];
    _labelS1Total.text =  [NSString stringWithFormat:@"%d",totalS1];
    if(totalS1 < 10)
        _labelS1Type1.text = NSLocalizedString(@"小", @"小");
    else
        _labelS1Type1.text = NSLocalizedString(@"大", @"大");
    
    if (totalS1 % 2 == 0)
        _labelS1Type2.text =NSLocalizedString(@"双", @"双");
    else
        _labelS1Type2.text =NSLocalizedString(@"单", @"单");
    
    _labelS2QiHao.text = modelS2.issueno;
    NSArray *arrsS2 = [modelS2.number componentsSeparatedByString:@" "];
    [_imageS21 setImage:[UIImage imageNamed:[NSString stringWithFormat:@"%@",arrsS2[0]]]];
    [_imageS22 setImage:[UIImage imageNamed:[NSString stringWithFormat:@"%@",arrsS2[1]]]];
    [_imageS23 setImage:[UIImage imageNamed:[NSString stringWithFormat:@"%@",arrsS2[2]]]];
    int totalS2 = [arrsS2[0] intValue] + [arrsS2[1] intValue] + [arrsS2[2] intValue];
    _labelS2Total.text =  [NSString stringWithFormat:@"%d",totalS2];
    if(totalS2 < 10)
        _labelS2Type1.text = NSLocalizedString(@"小", @"小");
    else
        _labelS2Type1.text = NSLocalizedString(@"大", @"大");
    
    if (totalS2 % 2 == 0)
        _labelS2Type2.text = NSLocalizedString(@"双", @"双");
    else
        _labelS2Type2.text = NSLocalizedString(@"单", @"单");
}

@end
